package com.chinaums.study.restful.entity;

import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalTime;

@Entity
@Table(name = "UMS_STUDY_FACE_COMPARE_LOG")
public class FaceCompareLog {

    private Long id;
    private String seqNo;
    private LocalDate tranDate;
    private LocalTime tranTime;
    private String returnCode;
    private String returnMsg;
    private int smlrVal;
    private int chkRslt;
    private String nodeName = System.getenv("COMPUTERNAME");

    @Id
    @GeneratedValue(strategy = GenerationType.TABLE)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSeqNo() {
        return seqNo;
    }

    public void setSeqNo(String seqNo) {
        this.seqNo = seqNo;
    }

    public LocalDate getTranDate() {
        return tranDate;
    }

    public void setTranDate(LocalDate tranDate) {
        this.tranDate = tranDate;
    }

    public LocalTime getTranTime() {
        return tranTime;
    }

    public void setTranTime(LocalTime tranTime) {
        this.tranTime = tranTime;
    }

    public String getReturnCode() {
        return returnCode;
    }

    public void setReturnCode(String returnCode) {
        this.returnCode = returnCode;
    }

    public String getReturnMsg() {
        return returnMsg;
    }

    public void setReturnMsg(String returnMsg) {
        this.returnMsg = returnMsg;
    }

    public int getSmlrVal() {
        return smlrVal;
    }

    public void setSmlrVal(int smlrVal) {
        this.smlrVal = smlrVal;
    }

    public int getChkRslt() {
        return chkRslt;
    }

    public void setChkRslt(int chkRslt) {
        this.chkRslt = chkRslt;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        FaceCompareLog that = (FaceCompareLog) o;

        if (smlrVal != that.smlrVal) return false;
        if (chkRslt != that.chkRslt) return false;
        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (seqNo != null ? !seqNo.equals(that.seqNo) : that.seqNo != null) return false;
        if (tranDate != null ? !tranDate.equals(that.tranDate) : that.tranDate != null) return false;
        if (tranTime != null ? !tranTime.equals(that.tranTime) : that.tranTime != null) return false;
        if (returnCode != null ? !returnCode.equals(that.returnCode) : that.returnCode != null) return false;
        if (returnMsg != null ? !returnMsg.equals(that.returnMsg) : that.returnMsg != null) return false;
        return nodeName != null ? nodeName.equals(that.nodeName) : that.nodeName == null;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (seqNo != null ? seqNo.hashCode() : 0);
        result = 31 * result + (tranDate != null ? tranDate.hashCode() : 0);
        result = 31 * result + (tranTime != null ? tranTime.hashCode() : 0);
        result = 31 * result + (returnCode != null ? returnCode.hashCode() : 0);
        result = 31 * result + (returnMsg != null ? returnMsg.hashCode() : 0);
        result = 31 * result + smlrVal;
        result = 31 * result + chkRslt;
        result = 31 * result + (nodeName != null ? nodeName.hashCode() : 0);
        return result;
    }
}
